let vm = new Vue({
    el: "#app",
    data: {
        taskName: "",
        taskList: []
    },
    methods: {
        addTask() {
            let obj = { id: this.taskList.length + 1, name: this.taskName, status: false };
            this.taskList.push(obj)
            this.taskName = "";
        },
        changStatus(item) {
            item.status = "true"
        },
        del(item, index) {
            console.log(item, index)
            this.taskList.splice(index, 1)

            // this.taskList = this.taskList.filter(element => {
            //     return element.id != item.id
            // // });
        }
    },
    computed: {
        unFinishCount() {
            let arr = this.taskList.filter(element => {
                return element.status == false
            });
            return arr.length
        }
    }
})